﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ODP.Com;
using ODP.Enum;
using ODP.Model;

namespace ODP.QQAPI
{
    public class QQOAuth : OAuthBase
    {
        public QQOAuth()
        {

            this.twitterType = TwitterType.QQ;
            this.baseurl = "http://open.t.qq.com/api/";
            this.Access_token_url = "https://open.t.qq.com/cgi-bin/access_token";
            this.Request_token_url = "https://open.t.qq.com/cgi-bin/request_token";
            this.customKey = "801076731";
            this.customSecret = "a310a4e2a6076ca2bf928a0399f08fa3";
            this.callbackUrl = "http://www.baidu.com";
            InitApiInfoList();
            
        }
        public QQOAuth(OAuthBase OAuth)
        {
            this.callbackUrl = OAuth.callbackUrl;
            this.Charset = OAuth.Charset;
            this.customKey = OAuth.customKey;
            this.customSecret = OAuth.customSecret;
            this.tokenKey = OAuth.tokenKey;
            this.tokenSecret = OAuth.tokenSecret;
            this.twitterType = TwitterType.QQ;
            this.verify = OAuth.verify;
            this.baseurl = "http://open.t.qq.com/api/";
            this.Access_token_url = "https://open.t.qq.com/cgi-bin/access_token";
            this.Request_token_url = "https://open.t.qq.com/cgi-bin/request_token";
            this.customKey = "801076731";
            this.customSecret = "a310a4e2a6076ca2bf928a0399f08fa3";
            this.callbackUrl = "http://www.baidu.com";
            InitApiInfoList();
        }

        void InitApiInfoList()
        {
            apiInfoList = new List<APIInfo>();
            apiInfoList.Add(new APIInfo("GetHomePage", "statuses/home_timeline", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("Forward", "t/re_add", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("GetOtherUserInfo", "user/other_info", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("Mention", "t/reply", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("WeiBoAdd", "t/add", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("WeiBoAddWithPic", "t/add_pic", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("GetCurrentUserInfo", "user/info", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("AddFriends", "friends/add", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("AddSpecialFriends", "friends/addspecial", HttpMethod.POST));
            apiInfoList.Add(new APIInfo("InviteFriends", "invite/event_invite", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetOtherUserFans", "friends/user_fanslist", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetOtherUserSpecialFans", "friends/user_speciallist", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetOtherUserIdol", "friends/user_idollist", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetCurrentUserFans", "friends/fanslist_s", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetCurrentUserIdol", "friends/idollist_s", HttpMethod.GET));
            apiInfoList.Add(new APIInfo("GetMayKownPerson", "other/kownperson", HttpMethod.GET));
        }
    }
}
